﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using SnippetBox.Core.Data.Models;

namespace SnippetBox.Web.Areas.Manage.Models {
    public class UserModel {
        public User User { get; set; }
        public string Password { get; set; }

        public UserModel() { }
        public UserModel(User user) {
            User = user;
        }

        private List<SelectListItem> _roles;
        public List<SelectListItem> Roles {
            get {
                if (_roles != null) 
                    return _roles;
                
                _roles = RoleName.GetSelectList().ToList();
                
                return _roles;
            }
        }
    }
}